﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using Micronet.OpenWeb.Common;
using Micronet.OpenWeb.Utils;

namespace Micronet.OpenWeb.OpenWeb.Admin.Views.Shared.OpenCommunity
{
    public partial class CommunityFieldOfActivitiesEdit : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {

            Membership.ValidateUser("openhome", "1234567!@#");
            FormsAuthentication.SetAuthCookie("openhome", true);


            if (OwConstants.QueryString.ID.OwQsIsExist())
            {
                CommunityFieldOfActivitiesDv.DefaultMode = DetailsViewMode.Edit;
            }
            else
            {
                CommunityFieldOfActivitiesDv.DefaultMode = DetailsViewMode.Insert;
            }


            CommunityFieldOfActivitiesOds.Inserted += new ObjectDataSourceStatusEventHandler(CommunityFieldOfActivitiesOds_Inserted);
            CommunityFieldOfActivitiesOds.Deleted += new ObjectDataSourceStatusEventHandler(CommunityFieldOfActivitiesOds_Deleted);
            CommunityFieldOfActivitiesOds.Updated += new ObjectDataSourceStatusEventHandler(CommunityFieldOfActivitiesOds_Updated);
        }

        void CommunityFieldOfActivitiesOds_Updated(object sender, ObjectDataSourceStatusEventArgs e)
        {
            Response.Redirect("CommunityFieldOfActivitiesAdmin.aspx");

        }

        void CommunityFieldOfActivitiesOds_Deleted(object sender, ObjectDataSourceStatusEventArgs e)
        {
            Response.Redirect("CommunityFieldOfActivitiesAdmin.aspx");

        }

        void CommunityFieldOfActivitiesOds_Inserted(object sender, ObjectDataSourceStatusEventArgs e)
        {
            Response.Redirect("CommunityFieldOfActivitiesAdmin.aspx");
        }


    }
}